package com.andyou.modules.content.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.andyou.common.persistence.Page;
import com.andyou.common.service.CrudService;
import com.andyou.modules.content.entity.ContentAccount;
import com.andyou.modules.content.dao.ContentAccountDao;

/**
 * 账号管理（content_account）Service
 * @author lgx
 * @version 2020-03-08
 */
@Service
@Transactional(readOnly = true)
public class ContentAccountService extends CrudService<ContentAccountDao, ContentAccount> {

	public ContentAccount get(String id) {
		return super.get(id);
	}
	
	public List<ContentAccount> findList(ContentAccount contentAccount) {
		return super.findList(contentAccount);
	}
	
	public Page<ContentAccount> findPage(Page<ContentAccount> page, ContentAccount contentAccount) {
		return super.findPage(page, contentAccount);
	}
	
	@Transactional(readOnly = false)
	public int save(ContentAccount contentAccount) {
		return super.save(contentAccount);
	}
	
	@Transactional(readOnly = false)
	public void delete(ContentAccount contentAccount) {
		super.delete(contentAccount);
	}
	
	
    @Transactional(readOnly = false)
	public void batchDelete(List<String> idList) {
		ContentAccount contentAccount = null;
		for (String id : idList) {
			contentAccount = new ContentAccount();
			contentAccount.setId(id);
			super.delete(contentAccount);
		}
	}
}